<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
</head>
<body>
  <a href="http://www.baidu.com">百度一下,你就不知道</a>
  <script>
      let a = document.getElementsByTagName("a")[0];
      //获取对象的属性
      console.log(a.href)
      //修改属性
      a.href = 'http://www.taobao.com'
  </script>
</body>
</html>